package com.ls.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * <p>
 * 预定时段表
 * </p>
 *
 * @author pengyu
 * @since 2024-06-28
 */
@NoArgsConstructor
@Data
@EqualsAndHashCode(callSuper = false)
public class BookingTime extends Model<BookingTime> {
    private static final long serialVersionUID=1L;
    /**
     * 自增主键
     */
    @TableId(value = "time_id", type = IdType.AUTO)
    private Long timeId;
    /**时段名称*/
    private String timeName;
    /**时段开始时间*/
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    @JSONField(format = "HH:mm")
    private LocalTime startTime;
    /**时段结束时间*/
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    @JSONField(format = "HH:mm")
    private LocalTime endTime;
    /**
     * 绑定用户id，来自customer表
     */
    private Long customerId;
    /**
     * 公司id，来自company表
     */
    private Long companyId;
    /**创建时间*/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**更新时间*/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    @Override
    protected Serializable pkVal() {
        return this.timeId;
    }
}
